﻿<UserControl x:Class="Tanmia.Warehouse.Presentation.Scenarios.ItemEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:basis="clr-namespace:Tanmia.Basis.WPF.Controls;assembly=Tanmia.Basis"
             xmlns:c="clr-namespace:Tanmia.Warehouse.Presentation.Scenarios"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <TabControl Style="{x:Null}">
        <TabItem Header="معلومات المادة" Style="{x:Null}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="120" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="120" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>

                <Label Content="{basis:Labeler Path=Entity.ElementID}" Grid.Column="0" Grid.Row="0" />
                <TextBox Text="{Binding Path=Entity.ElementID, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="0" IsReadOnly="True" />

                <Label Content="{basis:Labeler Path=Entity.Name}" Grid.Column="0" Grid.Row="1" />
                <TextBox Text="{Binding Path=Entity.Name, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="1" />

                <Label Content="{basis:Labeler Path=Entity.Number}" Grid.Column="2" Grid.Row="1" />
                <TextBox Text="{Binding Path=Entity.Number, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="3" Grid.Row="1" />

                <Label Content="{basis:Labeler Path=Entity.EngName}" Grid.Column="0" Grid.Row="2" />
                <TextBox Text="{Binding Path=Entity.EngName, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="2" />

                <Label Content="{basis:Labeler Path=Entity.Code}" Grid.Column="2" Grid.Row="2" />
                <TextBox Text="{Binding Path=Entity.Code, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="3" Grid.Row="2" />

                <CheckBox IsChecked="{Binding Path=Entity.StopInput}" Content="{basis:Labeler Path=Entity.StopInput}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3" VerticalAlignment="Center" />
                <CheckBox IsChecked="{Binding Path=Entity.StopOutput}" Content="{basis:Labeler Path=Entity.StopOutput}" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="3" VerticalAlignment="Center" />

                <Label Content="{basis:Labeler Path=Entity.Minimum}" Grid.Column="0" Grid.Row="4" />
                <TextBox Text="{Binding Path=Entity.Minimum, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="4" />

                <Label Content="{basis:Labeler Path=Entity.Maximum}" Grid.Column="2" Grid.Row="4" />
                <TextBox Text="{Binding Path=Entity.Maximum, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="3" Grid.Row="4" />

                <CheckBox IsChecked="{Binding Path=Entity.BalanceExceeding}" Content="{basis:Labeler Path=Entity.BalanceExceeding}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="5" VerticalAlignment="Center" />
                <Label Content="{basis:Labeler Path=Entity.ItemBarcode}" Grid.Column="0" Grid.Row="6" />
                <TextBox Text="{Binding Path=Entity.ItemBarcode, NotifyOnValidationError=True, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="6" />

                <Label Content="{basis:Labeler Path=Entity.Category}" Grid.Column="2" Grid.Row="6" />
                <ComboBox SelectedItem="{Binding Path=Entity.Category}" ItemsSource="{Binding Path=ItemCategories}" DisplayMemberPath="Name" Grid.Column="3" Grid.Row="6" />

                <Label Content="طريقة تحريك المادة: " Grid.Column="0" Grid.Row="7" />
                <ComboBox Grid.Column="1" Grid.Row="7">
                    <ComboBoxItem Content="بإستخدام الأرقام التسلسلية" />
                    <ComboBoxItem Content="بإستخدام اللوتات" />
                    <ComboBoxItem Content="بإستخدام مميزات المادة" />
                </ComboBox>
            </Grid>
        </TabItem>

        <TabItem Header="وحدات القياس" Style="{x:Null}">
            <c:ItemUnitEditor DataContext="{Binding}" />
        </TabItem>

        <TabItem Header="الأسعار" Style="{x:Null}">
            <c:ItemUnitPriceEditor />
        </TabItem>

        <TabItem Header="طريقة تحريك المادة" Style="{x:Null}"></TabItem>
    </TabControl>
</UserControl>
